package com.taomeishu.mailcrazy.fetch.policy;

import com.taomeishu.mailcrazy.CheckResult;
import com.taomeishu.mailcrazy.util.CollectionUtil;

/**
 * 出现异常或是有mail存在时进行保存
 * @author pister 2012-4-1 下午09:29:47
 */
public class DefaultSavePolicy implements SavePolicy {

	@Override
	public boolean needSave(CheckResult checkResult, Exception exception) {
		if (exception != null) {
			return true;
		}
		if (!CollectionUtil.isEmpty(checkResult.getExistMails())) {
			return true;
		}
		return false;
	}

}
